#region (c) 2014 THN Solutions LLC. - All rights reserved
/*
THN DATA ABSTRACTION LAYER version 1

Copyright (c) 2014, THN Solutions LLC. ( www.ThnSolutions.com )
Author: Nguyễn, M. Hải                 ( www.Minh-Hai.com     )
All rights reserved.

This library is dual-licensed.
  + For commercial software, please obtain a commercial license from THN Solutions LLC.

  + For free software, this library is licensed under GPL version 3. A summary of GPLv3 is
    listed below. You should also find a copy of GPLv3 as file License_GPLv3.txt included
	with the source-code files.

    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License version 3 as published by
    the Free Software Foundation  of the License.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with this program.  If not, see <http://www.gnu.org/licenses/>.
*/
#endregion

#region Record of Change
//             							CHANGE HISTORY
// -------------------------------------------------------------------------------------
// |   DATE    | DEVELOPER  | DESCRIPTION                                              |
// -------------------------------------------------------------------------------------
// | 15-May-12 | HaiNM      | First creation.                                          |
// -------------------------------------------------------------------------------------
//
#endregion

#region Record of Audit
//             							REVIEW HISTORY
// -------------------------------------------------------------------------------------
// |   DATE    | REVIEWER   | NOTES                                                    |
// -------------------------------------------------------------------------------------
// -------------------------------------------------------------------------------------
//
#endregion

#region Using directives
using System;

using Thn;
using Thn.Data;
using Thn.Data.Mapping;
#endregion

namespace Demo
{
    /// <summary>
    /// A sample business object to be mapped with a table in database.
    /// </summary>
#if DEBUG || TESTING
    public
#else
    public
#endif
 class User
    {
        #region Fields
        #endregion

        #region Properties

        #region ID
        private Guid mID;
        /// <summary>
        /// Gets or sets description.
        /// </summary>
        [Identifier] //mark this property as the identifier
        [Savable]//mark this property as to be saved to database
        public Guid ID
        {
            get { return mID; }
            set { mID = value; }
        }
        #endregion

        #region Name
        private string mName;
        /// <summary>
        /// Gets or sets description.
        /// </summary>
        [Savable]
        public string Name
        {
            get { return mName; }
            set { mName = value; }
        }
        #endregion

        #region DOB
        private DateTime mDOB;
        /// <summary>
        /// Gets or sets description.
        /// </summary>
        [Savable]
        [Column(Name = "DOB", Required = true)] //Map this property to a specific column name in the actual table
        public DateTime DOB
        {
            get { return mDOB; }
            set { mDOB = value; }
        }
        #endregion

        #region Nullable DateTime
        private DateTime? mNullableDateTime;
        /// <summary>
        /// Gets or sets description.
        /// </summary>
        [Savable]
        public DateTime? NullableDateTime
        {
            get { return mNullableDateTime; }
            set { mNullableDateTime = value; }
        }
        #endregion

        #region Nullable Int
        private int? mNullableInt;
        /// <summary>
        /// Gets or sets description.
        /// </summary>
        [Savable]
        public int? NullableInt
        {
            get { return mNullableInt; }
            set { mNullableInt = value; }
        }
        #endregion

        #region Nullable Guid
        private Guid? mNullableGuid;
        /// <summary>
        /// Gets or sets description.
        /// </summary>
        [Savable]
        public Guid? NullableGuid
        {
            get { return mNullableGuid; }
            set { mNullableGuid = value; }
        }
        #endregion

        #endregion

        #region To String
        public override string ToString()
        {
            return string.Format("Name: {0} DOB: {1} ID: {2}", mName, mDOB, mID);
        }
        #endregion

        #region Constructors
        /// <summary>
        /// Default constructor.
        /// </summary>
        public User()
        { }
        #endregion
    }
}
